import Vue from 'vue'
import App from './App.vue'

// 注册三级联动组件为全局组件
import TypeNav from './components/TypeNav'
Vue.component(TypeNav.name, TypeNav)
    // 注册轮播图组件为全局组件
import Carousel from './components/Carousel'
Vue.component(Carousel.name, Carousel)
    // 注册分页器组件
import Pagination from './components/Pagination'
Vue.component(Pagination.name, Pagination)
    // 引入路由
import router from '../src/router'
Vue.config.productionTip = false

// 引入仓库
import store from './store'

// 引入mockServer.js
import './mock/mockServer'

// 引入swiper样式轮播图
import "swiper/css/swiper.css"

import { reqCategoryList } from './api'
reqCategoryList();
new Vue({
    render: h => h(App),
    // 注册路由信息
    router,
    // 注册Vuex
    store,
    beforeCreate() {
        Vue.prototype.$bus = this //安装全局事件总线，$bus就是当前应用的vm
    },
}).$mount('#app')